var userInfo = null;
    $.ajax({
        type: "get",
        url: "/user/queryUserMessage",
        async: false,
        success: function (response) {
            if(response.error && response.error == 400){
                location.href = "login.html";
            }
            userInfo = response;
            console.log(userInfo);
        }
    });




$(function () {

    $("#logout").on("click", function () {
        $.ajax({
            type: "get",
            url: "/user/logout",
            success: function (response) {
                if (response.success) {
                    mui.toast("退出登录成功");
                    setTimeout(function () {
                        location.href = "index.html";
                    }, 2000);
                }

            }
        });
    });

    var html = template("userTpl",userInfo);
    console.log(html);
    $("#userInfoBox").html(html);

});